from force_generator import ForceGenerator

class EarthFG(ForceGenerator):
    '''Simulate the force of earth's gravity'''

    # acceleration due to the earth's gravity
    ACCELERATION_GRAV = -9.8

    def act_on_particle(self, particle):
        if not particle.has_attribute(self.generator_name + "_NoEarthForce"):
            particle.sum_forces.y += self.ACCELERATION_GRAV
